{
    //接口用来定义一个对象的类型
    //在定义类型的时候 属性和类型都是固定的

    interface obj1Type{
        name:string,
        age:number
    }

    const obj1:obj1Type= {
        age:18,
        name:'尹伟'
    }

    //可选属性(有或者没有这个属性)
    interface obj2Type{
        name:string,
        age:number,
        sex?: any
    }

    const obj2:obj2Type ={
        name:'尹伟',
        age:18,
        sex:132
    }
    //3.对象中有数组
    type obj3ScoreType = number[]

    interface obj3type {
        name:string,
        age:number,
        Score:obj3ScoreType
    }

    const obj3:obj3type = {
        name:'尹伟',
        age:18,
        Score:[
            1,
            2,
            3
        ]
    }

    //对象中有对象
    type obj4type3 = string[]
    interface obj4Type1 {
        name:string,
        age:number,
        orther:obj4Type2
    }
    interface obj4Type2{
        height:number,
        weight:number,
        gir:obj4type3
    }

    const obj4:obj4Type1 ={
        name:'yin',
        age:18,
        orther:{
            height:188,
            weight:120,
            gir:['吃饭','睡觉','打豆豆']
        }
    }

    //只读属性
    interface obj5Type{
        name:number,
        readonly age:number,
    }

    const obj5:obj5Type={
        name:18,
        age:18
    }

    obj5.name = 19
    // obj5.age=12
}